import { HybSendOutGoodsInfoDto } from './../HuoCustmp.model';
import { Component, OnInit } from '@angular/core';
import { ApiService } from '../../../../providers/ApiPro.service';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-HuoCusProInfo',
  templateUrl: './HuoCusProInfo.component.html',
  styleUrls: ['./HuoCusProInfo.component.scss']
})
export class HuoCusProInfoComponent implements OnInit {
  public proInfo: HybSendOutGoodsInfoDto = new HybSendOutGoodsInfoDto();
  data = [];
  constructor(
    public apiService: ApiService,
    private route: ActivatedRoute
  ) { }

  ngOnInit() {
    this.getId();
  }

    getId(){
     this.route.params.subscribe((params) => {
            this.load(params['id']);
            this.loadDriver(params['id']);
        });
  }

  load(id){
    let url = "findsendoutgoodsinfo"
    this.apiService.get(url,{"orderId":id})
      .then(res =>{
        this.proInfo = res.result;
      })
  }

  loadDriver(id){
    let url = "findsendoutgoodsordertakinginfo";
    this.apiService.get(url,{"orderId":id})
      .then(res =>{
        this.data = res.result;
      })
  }

}
